﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Globalization;

namespace System.Web.Mvc
{
    public static class LanguageBarHelper
    {
        public static string LanguageDropDownList(this HtmlHelper helper)
        { 
            //BAK CODE: iterate all the cultures supported by ASP.NET
            //List<System.Globalization.CultureInfo> Locales =
            //    System.Globalization.CultureInfo.GetCultures(System.Globalization.CultureTypes.NeutralCultures).ToList();

            Dictionary<string, string> cultures = new Dictionary<string, string>();
            cultures.Add("English", "en-us");
            cultures.Add("中文", "zh-cn");

            SelectList list=new SelectList(
                cultures,
                "value",
                "key",ResourceHtmlHelpers.GetCulture()); 

            return System.Web.Mvc.Html.SelectExtensions.DropDownList(helper, "languagelist", list);
        }
    }
}
